package com.igeek.controller;


import com.igeek.model.insurance.BankAccount;
import com.igeek.result.Result;
import com.igeek.service.IBankAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author author
 * @since 2024-08-23
 */
@RestController
@RequestMapping("/bank-account")
public class BankAccountController {
    @Autowired
    private IBankAccountService iBankAccountService;

    //获取信息
    @GetMapping("/getAll")
    public Result getAll(){
        List<BankAccount> list=iBankAccountService.list();
        return Result.ok(list);
    }

    //对账操作
    @PostMapping("/account/{id}")
    public Result account(@RequestBody BankAccount bankAccount, @PathVariable("id") Integer id){
        iBankAccountService.account(bankAccount,id);
    return Result.ok();}

}
